package com.luo.system.controller;

import java.util.List;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.luo.common.controller.BaseController;
import com.luo.common.utils.PageUtils;
import com.luo.common.utils.Query;
import com.luo.partner.dao.model.TabMonthlyKnotTemp;
import com.luo.partner.service.TabMonthlyKnotService;

@RequestMapping("/sys/settlement")
@Controller
public class SettlementController extends BaseController {
	private String prefix="system/settlement";
	
	@Autowired
	TabMonthlyKnotService tabMonthlyKnotService;
	
	@RequiresPermissions("sys:settlement:settlement")
	@GetMapping("")
	String user(Model model) {
		return prefix + "/list";
	}

	@GetMapping("/list")
	@ResponseBody
	PageUtils list(@RequestParam Map<String, Object> params) {
		// 查询列表数据
		Query query = new Query(params);
		List<TabMonthlyKnotTemp> list = tabMonthlyKnotService.findList(query);
		int total = tabMonthlyKnotService.countList(query);
		PageUtils pageUtil = new PageUtils(list, total);
		return pageUtil;
	}
}